Two types of serial communication protocols required for a programmable controller exist: a computer link-only protocol and a general-purpose communication protocol. In the computer link-only protocol, a message to be accessed is fixed to one having a header and application data, and a programmable controller sends and receives data based on a fixed command that is sent from partner equipment (a measuring device, a personal computer and the like). Therefore, the computer link-only protocol does not require a user program. Thus, the computer link-only protocol can read/write device data of the programmable controller or a user program from and into the partner equipment such as the computer and can monitor a state of the programmable controller equipment without preparing the user program in the programmable controller.
On the other hand, because the general-purpose communication protocol can send and receive data in an arbitrary message format which meets the specification of the partner equipment, it is possible to establish communication between a programmable controller and partner equipment which includes other serial port. For this reason, in order to establish the communication between the programmable controller and the partner equipment which includes other serial port, it is necessary to form a sequence program for controlling communication suitable for the communication partner equipment.
A programmable controller having a large number of serial ports becomes costly and bulky; therefore, it is common that the programmable controller includes only one of the computer link-only protocol and the general-purpose communication protocol.
Japanese Patent No. 3234240 discloses a programmable controller with a parameter area into which a parameter for properly using serial ports so that both the computer link-only protocol function and the general-purpose communication protocol function can be used. A parameter for selecting and setting one of a general-purpose communication function and a computer link function is set in this parameter area, and with this configuration, communication control functions of the serial ports are switched.
Japanese Patent Application Laid-open No. 2002-157014 discloses a programmable controller that can switch a communication mode in which a programmable display establishes communication with a personal computer and a communication mode in which a programmable display establishes communication with a PLC, the programmable display includes a communication middleware for switching the communication modes.
The communication middleware switches the communication modes by a set signal from the personal computer which is connected to a serial port in the programmable display.
In the programmable controller disclosed in Japanese Patent No. 3234240, however, if a use is set in accordance with a newly provided parameter area, the use is fixed to the set contents, and the use of the serial port can not dynamically be switched. As a result, there is a problem that both the computer link function and the general-purpose communication function can not be used by switching the communication control processing of the serial port.
In the programmable controller disclosed in Japanese Patent Application Laid-open No. 2002-157014, the middleware itself can not change the communication control method and thus, the communication control method of the programmable display is switched by operating a personal computer. Therefore there is a problem that the personal computer is required apart from the programmable display.